import fetch from '@/utils/fetch'

// 备机一览
export function apiGetApplyList(listQuery) {
  return fetch({
    url: '/api/v1/spare/list',
    method: 'GET',
    params: listQuery
  })
}

export function apiGetAllocateList(listQuery) {
  return fetch({
    url: '/api/v1/allot/list',
    method: 'GET',
    params: listQuery
  })
}

export function apiGetScrapList(listQuery) {
  return fetch({
    url: '/api/v1/scrap/list',
    method: 'GET',
    params: listQuery
  })
}
export function apiGetSpareStockList(listQuery) {
  return fetch({
    url: '/api/v1/stock/spareList',
    method: 'GET',
    params: listQuery
  })
}

export function apiSpareExport (listQuery) {
  return fetch({
    url: '/api/v1/spare/export',
    method: 'post',
    data: listQuery,
    responseType: 'arraybuffer'
  })
}

export function apiSpareAllotExport (listQuery) {
  return fetch({
    url: '/api/v1/allot/export',
    method: 'post',
    data: listQuery,
    responseType: 'arraybuffer'
  })
}

export function apiSpareScrapExport (listQuery) {
  return fetch({
    url: '/api/v1/stock/scrap/export',
    method: 'post',
    data: listQuery,
    responseType: 'arraybuffer'
  })
}

export function apiSpareStockExport (listQuery) {
  return fetch({
    url: '/api/v1/stock/export',
    method: 'post',
    data: listQuery,
    responseType: 'arraybuffer'
  })
}
